<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org">
<head>
    <th:block th:include="include :: header('新增成品')"/>
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
    <form class="form-horizontal m" id="form-iteminfo-add">
        <div class="form-group">
            <label class="col-sm-3 control-label">请选择产品:</label>
            <div class="col-sm-8">
                <select name="productInfoId" class="form-control m-b" th:with="type=${@productService.getProductInfo()}">
                    <option th:each="dict : ${type}" th:text="${dict.nameAndNo}"
                            th:value="${dict.id}"></option>
                </select>
            </div>
            <div class="form-group">
                <label class="col-sm-3 control-label">生成成品数量：</label>
                <div class="col-sm-8">
                    <input id="productNum" name="productNum" placeholder="请输入成品数量" class="form-control" type="text" maxlength="2" value="1">
                </div>
            </div>
        </div>
    </form>
</div>
<th:block th:include="include :: footer"/>
<script th:inline="javascript">
    var prefix = ctx + "system/iteminfo"
    $("#form-iteminfo-add").validate({
        focusCleanup: true,
        rules:{
            productNum:{
                digits:true
            }
        }
    });

    function submitHandler() {
        if ($.validate.form()) {
            $.operate.save(prefix + "/add", $('#form-iteminfo-add').serialize());
        }
    }
</script>
</body>
</html>